package control;

import entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;

@Controller
public class UserConrtoller {
   /*@RequestMapping("/login.do")
    public String checkLogin(User user){
        System.out.println(user.getName()+"\t"+user.getPwd());
        return "index";
    }*/
    @RequestMapping("/log.do")
    public String checkLogin2(HttpServletRequest request, Model model) {
        String name=request.getParameter("name");
        String pwd=request.getParameter("pwd");
        User u=new User();
        u.setName(name);
        u.setPwd(pwd);
        model.addAttribute("us",u);
        return "index";
    }

}
